home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 2 / ETO Development Tools 2.iso / Tools - Objects / MacApp / MacApp CD Release / MacApp 2.0.1 (Many Libraries) / Interfaces / PInterfaces / UDialog.p < prev    next >
Encoding:
Text File  |  1990-10-25  |  35.5 KB  |  963 lines  |  [TEXT/MPS ]

  1. {[a-,body+,h-,o=100,r+,rec+,t=4,u+,#+,j=20/57/1$,n-]}
  2. {UDialog.p}
  3. {Copyright © 1988-1990 by Apple Computer Inc.  All rights reserved.}
  4.  
  5. {$IFC UNDEFINED UsingIncludes}
  6. {$SETC UsingIncludes := FALSE}
  7. {$ENDC}
  8.  
  9. {$IFC NOT UsingIncludes}
  10. UNIT UDialog;
  11.  
  12.     INTERFACE
  13.         {$ENDC}
  14.  
  15.         {$IFC UNDEFINED __UDialog__}
  16.         {$SETC __UDialog__ := FALSE}
  17.         {$ENDC}
  18.  
  19.         {$IFC NOT __UDialog__}
  20.         {$SETC __UDialog__ := TRUE}
  21.  
  22.         { • Auto-Include the requirements for this unit's interface. }
  23.         {$SETC UDialogIncludes := UsingIncludes}
  24.         {$SETC UsingIncludes := TRUE}
  25.         {$I+}
  26.         {$IFC UNDEFINED __UMacApp__} {$I UMacApp.p} {$ENDC}
  27.         {$IFC UNDEFINED __UTEView__} {$I UTEView.p} {$ENDC}
  28.         {$SETC UsingIncludes := UDialogIncludes}
  29.  
  30.         CONST
  31.             kPreferColor        = TRUE;                 { argument to IIcon }
  32.             kControlOn            = TRUE;                 { argument to ICheckBox and IRadio }
  33.  
  34.             { Constants for TDialogView.Dismiss }
  35.             kFlash                = TRUE;                 { Constants for TDialogView.Dismiss. }
  36.             kDontFlash            = FALSE;                { Constants for TDialogView.Dismiss. }
  37.  
  38.             kFrame                = [adnLineTop, adnLineLeft, adnLineBottom, adnLineRight]; { Constant
  39.                 defining that a view be completely framed. }
  40.  
  41.             kMaxTEWidth         = $2B0;                 { Maximum width for TEditText autoscroll }
  42.  
  43.             phInvalidValue        = 300;                    { Alert used when an invalid value is
  44.                                                          entered }
  45.  
  46.             kInvalidValueReasons = 300;                 { String list used for invalid value alert }
  47.             kErrorHandled        = - 1;                    { Don't post an alert, the user handled it }
  48.             kValidValue         = 0;                    { Not looked up in the string list. }
  49.             kInvalidValue        = 1;
  50.             kValueTooSmall        = 2;
  51.             kValueTooLarge        = 3;
  52.             kNonNumericCharacters = 4;
  53.             kTooManyCharacters    = 5;
  54.             kNoOfDefaultReasons = 5;
  55.  
  56.         TYPE
  57.  
  58.             DialogViewTemplate    = RECORD
  59.                 defaultItem:        IDType;
  60.                 cancelItem:         IDType;
  61.                 END;
  62.             DialogViewTemplatePtr = ^DialogViewTemplate;
  63.  
  64.             {$IFC qHasForward}
  65.             TEditText             = OBJECT;    FORWARD;
  66.             TDialogTEView        = OBJECT;    FORWARD;
  67.             {$EndC}
  68.  
  69.             TDialogView         = OBJECT (TView)        { Mimics normal toolbox dialogs providing
  70.                                                          behavior for handling default buttons,
  71.                                                          param text, currently selected edit text
  72.                                                          and other behavior typically associated
  73.                                                          with dialogs. }
  74.                 fDefaultItem:        IDType;             { The identifier of the default item }
  75.                 fCancelItem:        IDType;             { The identifier of item that cancels dialog
  76.                                                          }
  77.                 fParamTxt:            TAssociation;        { the list of TEntrys for replacement }
  78.                 fCurrentEditText:    TEditText;            { Currently selected edit text item }
  79.                 fTEView:            TDialogTEView;        { Used for editing in EditText views }
  80.                 fDismissed:         BOOLEAN;            { Has the dialog been dismissed? }
  81.                 fDismisser:         IDType;             { ID of view that caused dismissal }
  82.  
  83.                 PROCEDURE TDialogView.IDialogView(itsDocument: TDocument;
  84.                                                   itsSuperView: TView;
  85.                                                   itsLocation: VPoint;
  86.                                                   itsSize: VPoint;
  87.                                                   itsHSizeDet: SizeDeterminer;
  88.                                                   itsVSizeDet: SizeDeterminer;
  89.                                                   itsDefItemID: IDType;
  90.                                                   itsCancelItemID: IDType);
  91.                 { Initialization method for TDialogView. }
  92.  
  93.                 PROCEDURE TDialogView.IRes(itsDocument: TDocument;
  94.                                            itsSuperView: TView;
  95.                                            VAR itsParams: Ptr); OVERRIDE;
  96.                 { For initializing a dialog view from a resource template. }
  97.  
  98.                 PROCEDURE TDialogView.WRes(theResource: ViewRsrcHndl;
  99.                                            VAR itsParams: Ptr); OVERRIDE;
  100.                 { For writing a dialog view out to a resource. }
  101.  
  102.                 PROCEDURE TDialogView.WriteRes(theResource: ViewRsrcHndl;
  103.                                                VAR itsParams: Ptr); OVERRIDE;
  104.                 { For writing a dialog view to a resource, works in conjunction with tbe
  105.                 previous method. }
  106.  
  107.                 PROCEDURE TDialogView.Free; OVERRIDE;
  108.                 { Frees fParamTxt then removes the sub view fTEView before calling inherited Free. }
  109.  
  110.                 FUNCTION TDialogView.CanDismiss(dismissing: IDType): BOOLEAN;
  111.                 { Used to check whether the dialog view can be dismissed or not by checking if the
  112.                 view is enabled, then check if the currently selected edit text is valid. }
  113.  
  114.                 PROCEDURE TDialogView.CantDeselect(theEditText: TEditText;
  115.                                                    reason: LONGINT);
  116.  
  117.                 PROCEDURE TDialogView.Close; OVERRIDE;
  118.                 { Called to close a dialog view. }
  119.  
  120.                 PROCEDURE TDialogView.DismissDialog(dismisser: IDType);
  121.                 { The method responsible for actually dismissing a dialog. }
  122.  
  123.                 FUNCTION TDialogView.DoCommandKey(ch: CHAR;
  124.                                                   VAR info: EventInfo): TCommand; OVERRIDE;
  125.                 { Called when a keyDown event is received and the command key is down. }
  126.  
  127.                 FUNCTION TDialogView.DoKeyCommand(ch: CHAR;
  128.                                                   aKeyCode: INTEGER;
  129.                                                   VAR info: EventInfo): TCommand; OVERRIDE;
  130.                 { This method handles all key presses other than a command key press, which is
  131.                 handled by the previous method. }
  132.  
  133.                 PROCEDURE TDialogView.DoOpen;
  134.                 { If when opening the dialog the current target is an edit text field of the dialog,
  135.                 then select it. }
  136.  
  137.                 FUNCTION TDialogView.DeselectCurrentEditText: BOOLEAN;
  138.                 { Deselects the current edit text, this is called when tabbing between edit text
  139.                 fields. }
  140.  
  141.                 PROCEDURE TDialogView.DoSelectEditText(theEditText: TEditText;
  142.                                                        selectChars: BOOLEAN);
  143.                 { Selects theEditText, is selectChars then all the characters are selected otherwise
  144.                 the insertion point is merely placed at the start of the field. }
  145.  
  146.                 PROCEDURE TDialogView.EachEditText(PROCEDURE
  147.                                                    DoToEditText(theEditText: TEditText));
  148.                 { Iterates over all the edit text items in the dialog calling DoToEditText for
  149.                 each item. }
  150.  
  151.                 FUNCTION TDialogView.GetDialogView: TView; OVERRIDE;
  152.                 { Returns a reference to the dialog view. }
  153.  
  154.                 PROCEDURE TDialogView.Tab(tabBackward: BOOLEAN);
  155.                 { Handles the tabbing between edit text fields. }
  156.  
  157.                 PROCEDURE TDialogView.DoChoice(origView: TView;
  158.                                                itsChoice: INTEGER); OVERRIDE;
  159.                 { If the default or cancel key are pressed then dismisses the dialog, otherwise
  160.                 passes the message along the chain. If the hit was an edit text item then deselects
  161.                 the item. Otherwise if the hit is on some other control and it dismisses the dialog
  162.                 then dismiss it. }
  163.  
  164.                 FUNCTION TDialogView.MakeTEView: TDialogTEView;
  165.                 { Creates the floating TEView used with edit text fields. }
  166.  
  167.                 PROCEDURE TDialogView.Open; OVERRIDE;
  168.                 { Called to open a dialog. }
  169.  
  170.                 PROCEDURE TDialogView.ParamTxt(keyStr, valueStr: Str255);
  171.                 { Used to create paramTxt items for the dialog. Builds an association with keyStr
  172.                 and valueStr. All instance of keyStr in the dialog will be replaced with valueStr
  173.                 when the dialog is displayed. }
  174.  
  175.                 FUNCTION TDialogView.PoseModally: IDType;
  176.                 { Displays the dialog in a modal fashion waiting for a response, which is returned
  177.                 as the IDType of the button hit that causes the dialog to be dismissed. }
  178.  
  179.                 PROCEDURE TDialogView.ReplaceText(VAR theText: Str255);
  180.                 { If there are any param text items in the theText passed to this method then they
  181.                 are replaced with the appropriate values. }
  182.  
  183.                 PROCEDURE TDialogView.SelectEditText(itsIdentifier: IDType;
  184.                                                      selectChars: BOOLEAN);
  185.                 { If itsIdentifier can be found then the field is selected, selectChars if true means
  186.                 that all the text will be selected as opposed to the insertion point merely being
  187.                 placed in the field. }
  188.  
  189.                 PROCEDURE TDialogView.SurveyEditText(VAR first, last, next, previous: TEditText);
  190.                 { Iterates over the edit text items in the view finding the First, Last, Next and
  191.                 Previous items. }
  192.  
  193.                 PROCEDURE TDialogView.Fields(PROCEDURE
  194.                                              DoToField(fieldName: Str255;
  195.                                                        fieldAddr: Ptr;
  196.                                                        fieldType: INTEGER)); OVERRIDE;
  197.                 { Used by the Inspector and the Debugger to display the contents of this class's
  198.                 fields. }
  199.  
  200.                 END;
  201.  
  202.             ButtonTemplate        = RECORD
  203.                 itsLabel:            Str255;             { Actually, variable length }
  204.                 END;
  205.             ButtonTemplatePtr    = ^ButtonTemplate;
  206.  
  207.             TButton             = OBJECT (TCtlMgr)        { Mimics a typical toolbox button as used in
  208.                                                          a dialog. }
  209.                 PROCEDURE TButton.IButton(itsSuperView: TView;
  210.                                           itsLocation, itsSize: VPoint;
  211.                                           itsHSizeDet, itsVSizeDet: SizeDeterminer;
  212.                                           itsLabel: Str255);
  213.                 { Initializes the button setting the fDefChoice field to mButtonHit. }
  214.  
  215.                 PROCEDURE TButton.IRes(itsDocument: TDocument;
  216.                                        itsSuperView: TView;
  217.                                        VAR itsParams: Ptr); OVERRIDE;
  218.                 { Initialize the view from a resource template. }
  219.  
  220.                 PROCEDURE TButton.WRes(theResource: ViewRsrcHndl;
  221.                                        VAR itsParams: Ptr); OVERRIDE;
  222.                 { Write this object out as a view resource. }
  223.  
  224.                 PROCEDURE TButton.WriteRes(theResource: ViewRsrcHndl;
  225.                                            VAR itsParams: Ptr); OVERRIDE;
  226.                 { Set up the type and signature of this object and call WRes. }
  227.  
  228.                 PROCEDURE TButton.Fields(PROCEDURE DoToField(fieldName: Str255;
  229.                                                              fieldAddr: Ptr;
  230.                                                              fieldType: INTEGER)); OVERRIDE;
  231.                 { Used by the Inspector and the Debugger to display the contents of this class's
  232.                 fields. }
  233.  
  234.                 END;
  235.  
  236.             CheckBoxTemplate    = RECORD
  237.                 isOn:                BOOLEAN;
  238.                 itsLabel:            Str255;             { Actually, variable length }
  239.                 END;
  240.             CheckBoxTemplatePtr = ^CheckBoxTemplate;
  241.  
  242.             TCheckBox            = OBJECT (TCtlMgr)        { Provides the functionality of a toolbox
  243.                                                          checkbox. }
  244.                 PROCEDURE TCheckBox.ICheckBox(itsSuperView: TView;
  245.                                               itsLocation, itsSize: VPoint;
  246.                                               itsHSizeDet, itsVSizeDet: SizeDeterminer;
  247.                                               itsLabel: Str255;
  248.                                               isTurnedOn: BOOLEAN);
  249.                 { Initialize the checkbox setting fDefChoice to mCheckBoxHit. }
  250.  
  251.                 PROCEDURE TCheckBox.IRes(itsDocument: TDocument;
  252.                                          itsSuperView: TView;
  253.                                          VAR itsParams: Ptr); OVERRIDE;
  254.                 {  Initialize the view from a resource template. }
  255.  
  256.                 PROCEDURE TCheckBox.WRes(theResource: ViewRsrcHndl;
  257.                                          VAR itsParams: Ptr); OVERRIDE;
  258.                 { Write this object out as a view resource. }
  259.  
  260.                 PROCEDURE TCheckBox.WriteRes(theResource: ViewRsrcHndl;
  261.                                              VAR itsParams: Ptr); OVERRIDE;
  262.                 { Set up the type and signature of this object and call WRes. }
  263.  
  264.                 PROCEDURE TCheckBox.DoChoice(origView: TView;
  265.                                              itsChoice: INTEGER); OVERRIDE;
  266.                 { If the hit is mCheckBoxHit then toggle the checkbox. }
  267.  
  268.                 FUNCTION TCheckBox.IsOn: BOOLEAN;
  269.                 { Is the checkbox currently checked. }
  270.  
  271.                 PROCEDURE TCheckBox.SetState(state, redraw: BOOLEAN);
  272.                 { Sets the state of the checkbox to state and if redraw is TRUE redraws it. }
  273.  
  274.                 PROCEDURE TCheckBox.Toggle(redraw: BOOLEAN);
  275.                 { Toggles the state of the checkbox redraw it if redraw is TRUE. }
  276.  
  277.                 PROCEDURE TCheckBox.ToggleIf(matchState, redraw: BOOLEAN);
  278.                 { Toggles the state of the checkbox if matchState is TRUE redrawing if redraw is
  279.                 TRUE. }
  280.  
  281.                 PROCEDURE TCheckBox.Fields(PROCEDURE
  282.                                            DoToField(fieldName: Str255;
  283.                                                      fieldAddr: Ptr;
  284.                                                      fieldType: INTEGER)); OVERRIDE;
  285.                 { Used by the Inspector and the Debugger to display the contents of this class's
  286.                 fields. }
  287.  
  288.                 END;
  289.  
  290.             RadioTemplate        = RECORD
  291.                 isOn:                BOOLEAN;
  292.                 itsLabel:            Str255;             { Actually, variable length }
  293.                 END;
  294.             RadioTemplatePtr    = ^RadioTemplate;
  295.  
  296.             TRadio                = OBJECT (TCtlMgr)        { Provides the functionality of a toolbox
  297.                                                          radio button. }
  298.                 PROCEDURE TRadio.IRadio(itsSuperView: TView;
  299.                                         itsLocation, itsSize: VPoint;
  300.                                         itsHSizeDet, itsVSizeDet: SizeDeterminer;
  301.                                         itsLabel: Str255;
  302.                                         isTurnedOn: BOOLEAN);
  303.                 { Initalize the radio button procedurally. }
  304.  
  305.                 PROCEDURE TRadio.IRes(itsDocument: TDocument;
  306.                                       itsSuperView: TView;
  307.                                       VAR itsParams: Ptr); OVERRIDE;
  308.                 {  Initialize the view from a resource template. }
  309.  
  310.                 PROCEDURE TRadio.WRes(theResource: ViewRsrcHndl;
  311.                                       VAR itsParams: Ptr); OVERRIDE;
  312.                 { Write the object out as a view resource. }
  313.  
  314.                 PROCEDURE TRadio.WriteRes(theResource: ViewRsrcHndl;
  315.                                           VAR itsParams: Ptr); OVERRIDE;
  316.                 { Set up the type and signature of this object and call WRes. }
  317.  
  318.                 PROCEDURE TRadio.DoChoice(origView: TView;
  319.                                           itsChoice: INTEGER); OVERRIDE;
  320.                 { If the hit is mRadioHit then toggle the radio button. }
  321.  
  322.                 FUNCTION TRadio.IsOn: BOOLEAN;
  323.                 { Is the radio button currently on. }
  324.  
  325.                 PROCEDURE TRadio.SetState(state, redraw: BOOLEAN);
  326.                 { Sets the state of the radio button to state, redrawing if redraw is TRUE. }
  327.  
  328.                 PROCEDURE TRadio.Toggle(redraw: BOOLEAN);
  329.                 { Toggles the state of the radio button, redrawing if redraw is TRUE. }
  330.  
  331.                 PROCEDURE TRadio.ToggleIf(matchState, redraw: BOOLEAN);
  332.                 { Only toggles the state of the radio button if matchState is TRUE, redrawing if
  333.                 redraw is TRUE. }
  334.  
  335.                 PROCEDURE TRadio.Fields(PROCEDURE DoToField(fieldName: Str255;
  336.                                                             fieldAddr: Ptr;
  337.                                                             fieldType: INTEGER)); OVERRIDE;
  338.                 { Used by the Inspector and the Debugger to display the contents of this class's
  339.                 fields. }
  340.  
  341.                 END;
  342.  
  343.             ClusterTemplate     = RECORD
  344.                 itsLabel:            Str255;             { Actually, variable length }
  345.                 END;
  346.             ClusterTemplatePtr    = ^ClusterTemplate;
  347.  
  348.             TCluster            = OBJECT (TControl)     { Provides a mechanism whereby radio buttons
  349.                                                          can be grouped in clusters, such that when
  350.                                                          one of the buttons is selected the others
  351.                                                          are all deselected. Also can be utilized
  352.                                                          for providing labelled adornments around
  353.                                                          groups of dialog items. }
  354.                 fRsrcID:            INTEGER;            { resource ID of the cluster's label }
  355.                 fIndex:             INTEGER;            { currently selected item }
  356.                 fDataHandle:        StringHandle;        { the cluster's label }
  357.  
  358.                 PROCEDURE TCluster.ICluster(itsSuperView: TView;
  359.                                             itsLocation, itsSize: VPoint;
  360.                                             itsHSizeDet, itsVSizeDet: SizeDeterminer;
  361.                                             itsRsrcID, itsIndex: INTEGER);
  362.                 { Initialize the cluster procedurally. }
  363.  
  364.                 PROCEDURE TCluster.IRes(itsDocument: TDocument;
  365.                                         itsSuperView: TView;
  366.                                         VAR itsParams: Ptr); OVERRIDE;
  367.                 {  Initialize the view template. }
  368.  
  369.                 PROCEDURE TCluster.WRes(theResource: ViewRsrcHndl;
  370.                                         VAR itsParams: Ptr); OVERRIDE;
  371.                 { Write the object out as a view resource. }
  372.  
  373.                 PROCEDURE TCluster.WriteRes(theResource: ViewRsrcHndl;
  374.                                             VAR itsParams: Ptr); OVERRIDE;
  375.                 { Set up the type and signature of this object and call WRes. }
  376.  
  377.                 PROCEDURE TCluster.Free; OVERRIDE;
  378.                 { Release the label and call inherited free. }
  379.  
  380.                 PROCEDURE TCluster.Draw(area: Rect); OVERRIDE;
  381.                 { Frame the cluster if there is a label, then draw the label. }
  382.  
  383.                 PROCEDURE TCluster.DoChoice(origView: TView;
  384.                                             itsChoice: INTEGER); OVERRIDE;
  385.                 { Responsible for reset the radio buttons so that the last selected one is the only
  386.                 one selected. }
  387.  
  388.                 PROCEDURE TCluster.GetLabel(VAR theLabel: Str255);
  389.                 { Returns in theLable the text in the clusters label. }
  390.  
  391.                 PROCEDURE TCluster.ReleaseLabel;
  392.                 { Releases fDataHandle which is a string handle containing the text for the label. }
  393.  
  394.                 FUNCTION TCluster.ReportCurrent: IDType;
  395.                 { Returns the IDType of the currently selected item. }
  396.  
  397.                 PROCEDURE TCluster.SetLabel(theLabel: Str255;
  398.                                             redraw: BOOLEAN);
  399.                 { Sets the clusters label to be theLabel, redrawing if redraw is TRUE. }
  400.  
  401.                 PROCEDURE TCluster.Fields(PROCEDURE
  402.                                           DoToField(fieldName: Str255;
  403.                                                     fieldAddr: Ptr;
  404.                                                     fieldType: INTEGER)); OVERRIDE;
  405.                 { Used by the Inspector and the Debugger to display the contents of this class's
  406.                 fields. }
  407.                 END;
  408.  
  409.             IconTemplate        = RECORD
  410.                 preferColor:        BOOLEAN;
  411.                 rsrcID:             INTEGER;
  412.                 END;
  413.             IconTemplatePtr     = ^IconTemplate;
  414.  
  415.             TIcon                = OBJECT (TControl)     { Provides an icon that can behave as a
  416.                                                          button. }
  417.                 fPreferColor:        BOOLEAN;
  418.                 fRsrcID:            INTEGER;
  419.                 fDataHandle:        Handle;
  420.  
  421.                 PROCEDURE TIcon.IIcon(itsSuperView: TView;
  422.                                       itsLocation, itsSize: VPoint;
  423.                                       itsHSizeDet, itsVSizeDet: SizeDeterminer;
  424.                                       itsRsrcID: INTEGER;
  425.                                       preferColor: BOOLEAN);
  426.                 {  Initialize the view template. }
  427.  
  428.                 PROCEDURE TIcon.IRes(itsDocument: TDocument;
  429.                                      itsSuperView: TView;
  430.                                      VAR itsParams: Ptr); OVERRIDE;
  431.                 { Initialize the view template. }
  432.  
  433.                 PROCEDURE TIcon.WRes(theResource: ViewRsrcHndl;
  434.                                      VAR itsParams: Ptr); OVERRIDE;
  435.                 { Write the object out as a view resource. }
  436.  
  437.                 PROCEDURE TIcon.WriteRes(theResource: ViewRsrcHndl;
  438.                                          VAR itsParams: Ptr); OVERRIDE;
  439.                 { Set up the type and signature of this object and call WRes. }
  440.  
  441.                 PROCEDURE TIcon.Free; OVERRIDE;
  442.                 { Release the icon then call inherited Free. }
  443.  
  444.                 PROCEDURE TIcon.Draw(area: Rect); OVERRIDE;
  445.                 { Resonsible for drawing the icon and any required adornments. }
  446.  
  447.                 PROCEDURE TIcon.ReleaseIcon;
  448.                 { Releases the handle to the icon. }
  449.  
  450.                 PROCEDURE TIcon.SetIcon(theIcon: Handle;
  451.                                         redraw: BOOLEAN);
  452.                 { Sets fDataHandle to theIcon, redrawing if redraw is TRUE. }
  453.  
  454.                 PROCEDURE TIcon.Fields(PROCEDURE DoToField(fieldName: Str255;
  455.                                                            fieldAddr: Ptr;
  456.                                                            fieldType: INTEGER)); OVERRIDE;
  457.                 { Used by the Inspector and the Debugger to display the contents of this class's
  458.                 fields. }
  459.                 END;
  460.  
  461.             PatternTemplate     = RECORD
  462.                 preferColor:        BOOLEAN;
  463.                 rsrcID:             INTEGER;
  464.                 END;
  465.             PatternTemplatePtr    = ^PatternTemplate;
  466.  
  467.             TPattern            = OBJECT (TControl)     { Provides an object that can display a
  468.                                                          pattern and can also behave as a button if
  469.                                                          required. }
  470.                 fPreferColor:        BOOLEAN;
  471.                 fRsrcID:            INTEGER;
  472.                 fDataHandle:        Handle;
  473.  
  474.                 PROCEDURE TPattern.IPattern(itsSuperView: TView;
  475.                                             itsLocation, itsSize: VPoint;
  476.                                             itsHSizeDet, itsVSizeDet: SizeDeterminer;
  477.                                             itsRsrcID: INTEGER;
  478.                                             preferColor: BOOLEAN);
  479.                 { Initialize the pattern procedurally. }
  480.  
  481.                 PROCEDURE TPattern.IRes(itsDocument: TDocument;
  482.                                         itsSuperView: TView;
  483.                                         VAR itsParams: Ptr); OVERRIDE;
  484.                 { Initialize the view template. }
  485.  
  486.                 PROCEDURE TPattern.WRes(theResource: ViewRsrcHndl;
  487.                                         VAR itsParams: Ptr); OVERRIDE;
  488.                 { Write the object out as a view resource. }
  489.  
  490.                 PROCEDURE TPattern.WriteRes(theResource: ViewRsrcHndl;
  491.                                             VAR itsParams: Ptr); OVERRIDE;
  492.                 { Set up the type and signature of this object and call WRes. }
  493.  
  494.                 PROCEDURE TPattern.Free; OVERRIDE;
  495.                 { Release the pattern then call inherited Free. }
  496.  
  497.                 PROCEDURE TPattern.Draw(area: Rect); OVERRIDE;
  498.                 { Responsible for drawing the pattern and any required adornments. }
  499.  
  500.                 PROCEDURE TPattern.ReleasePattern;
  501.                 { Releases the pattern by disposing fDataHandle. }
  502.  
  503.                 PROCEDURE TPattern.SetPattern(thePattern: Handle;
  504.                                               redraw: BOOLEAN);
  505.                 { Sets fDataHandle to thePattern, redrawing if redraw is TRUE. }
  506.  
  507.                 PROCEDURE TPattern.Fields(PROCEDURE
  508.                                           DoToField(fieldName: Str255;
  509.                                                     fieldAddr: Ptr;
  510.                                                     fieldType: INTEGER)); OVERRIDE;
  511.                 { Used by the Inspector and the Debugger to display the contents of this class's
  512.                 fields. }
  513.                 END;
  514.  
  515.             PictureTemplate     = RECORD
  516.                 rsrcID:             INTEGER;
  517.                 END;
  518.             PictureTemplatePtr    = ^PictureTemplate;
  519.  
  520.             TPicture            = OBJECT (TControl)     { Provides an object that can display a PICT
  521.                                                          and if required behave like a button. }
  522.                 fRsrcID:            INTEGER;
  523.                 fDataHandle:        PicHandle;
  524.  
  525.                 PROCEDURE TPicture.IPicture(itsSuperView: TView;
  526.                                             itsLocation, itsSize: VPoint;
  527.                                             itsHSizeDet, itsVSizeDet: SizeDeterminer;
  528.                                             itsRsrcID: INTEGER);
  529.                 { Initialize the picture procedurally. }
  530.  
  531.                 PROCEDURE TPicture.IRes(itsDocument: TDocument;
  532.                                         itsSuperView: TView;
  533.                                         VAR itsParams: Ptr); OVERRIDE;
  534.                 { Initialize the view from a resource template. }
  535.  
  536.                 PROCEDURE TPicture.WRes(theResource: ViewRsrcHndl;
  537.                                         VAR itsParams: Ptr); OVERRIDE;
  538.                 { Write the object out as a view resource. }
  539.  
  540.                 PROCEDURE TPicture.WriteRes(theResource: ViewRsrcHndl;
  541.                                             VAR itsParams: Ptr); OVERRIDE;
  542.                 { Set up the type and signature of this object and call WRes. }
  543.  
  544.                 PROCEDURE TPicture.Free; OVERRIDE;
  545.                 { Release the picture then call inherited Free. }
  546.  
  547.                 PROCEDURE TPicture.Draw(area: Rect); OVERRIDE;
  548.                 { Responsible for drawing the PICT and any required adornments. }
  549.  
  550.                 PROCEDURE TPicture.ReleasePicture;
  551.                 { Releases the PICT by disposing of fDataHandle. }
  552.  
  553.                 PROCEDURE TPicture.SetPicture(thePicture: PicHandle;
  554.                                               redraw: BOOLEAN);
  555.                 { Sets fDataHandle to thePicture, redrawing if redraw is TRUE. }
  556.  
  557.                 PROCEDURE TPicture.Fields(PROCEDURE
  558.                                           DoToField(fieldName: Str255;
  559.                                                     fieldAddr: Ptr;
  560.                                                     fieldType: INTEGER)); OVERRIDE;
  561.                 { Used by the Inspector and the Debugger to display the contents of this class's
  562.                 fields. }
  563.                 END;
  564.  
  565.             PopupTemplate        = RECORD
  566.                 rsrcID:             INTEGER;
  567.                 currentItem:        INTEGER;
  568.                 itemOffset:         INTEGER;
  569.                 END;
  570.             PopupTemplatePtr    = ^PopupTemplate;
  571.  
  572.             TPopup                = OBJECT (TControl)     { Provides a popup menu that can have a
  573.                                                          label associated with it. }
  574.                 fRsrcID:            INTEGER;
  575.                 fMenuID:            INTEGER;
  576.                 fMenuHandle:        MenuHandle;
  577.                 fCurrentItem:        INTEGER;
  578.                 fItemOffset:        INTEGER;
  579.  
  580.                 PROCEDURE TPopup.IPopup(itsSuperView: TView;
  581.                                         itsLocation, itsSize: VPoint;
  582.                                         itsHSizeDet, itsVSizeDet: SizeDeterminer;
  583.                                         itsRsrcID, itsCurrentItem, itsItemOffset: INTEGER);
  584.                 { Initialize the popup procedurally. }
  585.  
  586.                 PROCEDURE TPopup.IRes(itsDocument: TDocument;
  587.                                       itsSuperView: TView;
  588.                                       VAR itsParams: Ptr); OVERRIDE;
  589.                 { Initialize the view template. }
  590.  
  591.                 PROCEDURE TPopup.WRes(theResource: ViewRsrcHndl;
  592.                                       VAR itsParams: Ptr); OVERRIDE;
  593.                 { Write the object out as a view resource. }
  594.  
  595.                 PROCEDURE TPopup.WriteRes(theResource: ViewRsrcHndl;
  596.                                           VAR itsParams: Ptr); OVERRIDE;
  597.                 { Set up the type and signature of this object and call WRes. }
  598.  
  599.                 PROCEDURE TPopup.Free; OVERRIDE;
  600.                 { Release the popup then calls inherited Free. }
  601.  
  602.                 PROCEDURE TPopup.AdjustBotRight;
  603.                 { Adjusts the width and height of the popup menu. }
  604.  
  605.                 PROCEDURE TPopup.CalcLabelRect(VAR theRect: Rect);
  606.                 { Calculates the size of the rect for the label. }
  607.  
  608.                 PROCEDURE TPopup.CalcMenuRect(VAR theRect: Rect);
  609.                 { Calculates the size of the rect for the menu. }
  610.  
  611.                 FUNCTION TPopup.DoMouseCommand(VAR theMouse: Point;
  612.                                                VAR info: EventInfo;
  613.                                                VAR hysteresis: Point): TCommand; OVERRIDE;
  614.                 { Responds to a mouse down on the popup menu by highlighting the label and then
  615.                 calling PopUpMenuSelect to handle the display of the menu and then sets the current
  616.                 item to the one selected. }
  617.  
  618.                 PROCEDURE TPopup.Draw(area: Rect); OVERRIDE;
  619.                 { Calls DrawPopupBox and DrawLabel to handle the drawing of the popup box and the
  620.                 label. }
  621.  
  622.                 PROCEDURE TPopup.DrawLabel(area: Rect);
  623.                 { Responsible for drawing the label. }
  624.  
  625.                 PROCEDURE TPopup.DrawPopupBox(area: Rect);
  626.                 { Does the actual drawing of the popup box. }
  627.  
  628.                 FUNCTION TPopup.GetCurrentItem: INTEGER;
  629.                 { Returns the currently check marked item. }
  630.  
  631.                 PROCEDURE TPopup.GetItemText(item: INTEGER;
  632.                                              VAR theText: Str255);
  633.                 { Gets the text for the currently selected item. }
  634.  
  635.                 PROCEDURE TPopup.ReleasePopup;
  636.                 { Releases the popup by disposing of the menu handle. }
  637.  
  638.                 PROCEDURE TPopup.SetCurrentItem(item: INTEGER;
  639.                                                 redraw: BOOLEAN);
  640.                 { Sets the currently selected item, redrawing is required. }
  641.  
  642.                 PROCEDURE TPopup.SetPopup(theMenu: MenuHandle;
  643.                                           theRsrcID, currentItem: INTEGER;
  644.                                           redraw: BOOLEAN);
  645.                 { Sets the fields of the popup to contain theMenu, with currentItem selected,
  646.                 redrawing if required. }
  647.  
  648.                 PROCEDURE TPopup.Fields(PROCEDURE DoToField(fieldName: Str255;
  649.                                                             fieldAddr: Ptr;
  650.                                                             fieldType: INTEGER)); OVERRIDE;
  651.                 { Used by the Inspector and the Debugger to display the contents of this class's
  652.                 fields. }
  653.                 END;
  654.  
  655.             StaticTextTemplate    = RECORD
  656.                 just:                INTEGER;
  657.                 data:                Str255;             { Actually, variable length }
  658.                 END;
  659.             StaticTextTemplatePtr = ^StaticTextTemplate;
  660.  
  661.             TStaticText         = OBJECT (TControl)     { Provides an object that represents a
  662.                                                          toolbox static text item. }
  663.                 fRsrcID:            INTEGER;            { ID of the string list that the string is
  664.                                                          in. }
  665.                 fIndex:             INTEGER;            { Index number for the string from the above
  666.                                                          list. }
  667.                 fDataHandle:        StringHandle;        { A handle to the actual string. }
  668.                 fJust:                INTEGER;            { Jusitification of the text in the field. }
  669.                 fAutoWrap:            BOOLEAN;            { TRUE to word wrap lines at the view boundary
  670.                                                         otherwise lines wrap at Carriage return. }
  671.  
  672.                 PROCEDURE TStaticText.IStaticText(itsSuperView: TView;
  673.                                                   itsLocation, itsSize: VPoint;
  674.                                                   itsHSizeDet, itsVSizeDet: SizeDeterminer;
  675.                                                   itsRsrcID, itsIndex: INTEGER);
  676.                 { Initialize the static text field procedurally. }
  677.  
  678.                 PROCEDURE TStaticText.IRes(itsDocument: TDocument;
  679.                                            itsSuperView: TView;
  680.                                            VAR itsParams: Ptr); OVERRIDE;
  681.                 { Initialize the view template. }
  682.  
  683.                 PROCEDURE TStaticText.WRes(theResource: ViewRsrcHndl;
  684.                                            VAR itsParams: Ptr); OVERRIDE;
  685.                 { Write the object out as a view resource. }
  686.  
  687.                 PROCEDURE TStaticText.WriteRes(theResource: ViewRsrcHndl;
  688.                                                VAR itsParams: Ptr); OVERRIDE;
  689.                 { Set up the type and signature of this object and call WRes. }
  690.  
  691.                 PROCEDURE TStaticText.Free; OVERRIDE;
  692.                 { Releases the text and then calls inherited Free. }
  693.  
  694.                 PROCEDURE TStaticText.DoSubstitution(VAR theText: Str255);
  695.                 { Calls ReplaceText so that any paramTxt items can be handled if needed. }
  696.  
  697.                 PROCEDURE TStaticText.Draw(area: Rect); OVERRIDE;
  698.                 { Draws the text by calling ImageText. }
  699.  
  700.                 PROCEDURE TStaticText.GetText(VAR theText: Str255);
  701.                 { If fDataHandle not NIL then returns the text, otherwise returns the null string. }
  702.  
  703.                 PROCEDURE TStaticText.ImageText(text: Ptr;
  704.                                                 length: LONGINT;
  705.                                                 box: Rect;
  706.                                                 just: INTEGER);
  707.                 { Draws the text using the toolbox routine TextBox. }
  708.  
  709.                 PROCEDURE TStaticText.ChangeWrap(newAutoWrap, redraw: BOOLEAN);
  710.                 { Changes auto-wrapping behavior, redrawing if requested }
  711.  
  712.                 PROCEDURE TStaticText.ReleaseText;
  713.                 { Releases the text by disposing of fDataHandle. }
  714.  
  715.                 PROCEDURE TStaticText.SetJustification(theJust: INTEGER;
  716.                                                        redraw: BOOLEAN);
  717.                 { Sets the justification of the text to theJust, redrawing if required. }
  718.  
  719.                 PROCEDURE TStaticText.SetText(theText: Str255;
  720.                                               redraw: BOOLEAN);
  721.                 { Sets the text to theText, redrawing if required. }
  722.  
  723.                 PROCEDURE TStaticText.Fields(PROCEDURE
  724.                                              DoToField(fieldName: Str255;
  725.                                                        fieldAddr: Ptr;
  726.                                                        fieldType: INTEGER)); OVERRIDE;
  727.                 { Used by the Inspector and the Debugger to display the contents of this class's
  728.                 fields. }
  729.                 END;
  730.  
  731.             EditTextTemplate    = RECORD
  732.                 maxChars:            INTEGER;
  733.                 controlChars:        ControlCharSet;
  734.                 END;
  735.             EditTextTemplatePtr = ^EditTextTemplate;
  736.  
  737.             TEditText            = OBJECT (TStaticText)    { Implements an edit text field. }
  738.                 fMaxChars:            INTEGER;
  739.                 fTEView:            TDialogTEView;
  740.                 fControlChars:        ControlCharSet;        { Control chars accepted in text }
  741.  
  742.                 PROCEDURE TEditText.IEditText(itsSuperView: TView;
  743.                                               itsLocation, itsSize: VPoint;
  744.                                               itsMaxChars: INTEGER);
  745.                 { Initialize the edit text item procedurally. }
  746.  
  747.                 PROCEDURE TEditText.IRes(itsDocument: TDocument;
  748.                                          itsSuperView: TView;
  749.                                          VAR itsParams: Ptr); OVERRIDE;
  750.                 { Initialize the view from a resource template. }
  751.  
  752.                 PROCEDURE TEditText.WRes(theResource: ViewRsrcHndl;
  753.                                          VAR itsParams: Ptr); OVERRIDE;
  754.                 { Write the object out as a view resource. }
  755.  
  756.                 PROCEDURE TEditText.WriteRes(theResource: ViewRsrcHndl;
  757.                                              VAR itsParams: Ptr); OVERRIDE;
  758.                 { Set up the type and signature of this object and call WRes. }
  759.  
  760.                 PROCEDURE TEditText.Free; OVERRIDE;
  761.                 { Un-installs the floating TEView, sets fTEView to NIL then calls inherited Free. }
  762.  
  763.                 FUNCTION TEditText.HandleMouseDown(theMouse: VPoint;
  764.                                                VAR info: EventInfo;
  765.                                                VAR hysteresis: Point;
  766.                                                VAR theCommand: TCommand): BOOLEAN; OVERRIDE;
  767.                 { Gets the floating TE installed if necessary and forwards the call to it. }
  768.  
  769.                 PROCEDURE TEditText.DoSubstitution(VAR theText: Str255); OVERRIDE;
  770.                 { Default is to do nothing. }
  771.  
  772.                 PROCEDURE TEditText.Draw(area: Rect); OVERRIDE;
  773.                 { If TEView not NIL then calls TEView.Draw before performing any required adornments,
  774.                 else calls inherited Draw. }
  775.  
  776.                 PROCEDURE TEditText.GetText(VAR theText: Str255); OVERRIDE;
  777.                 { If TEView not NIL then returns the extracted text, otherwise calls inherited
  778.                 GetText. }
  779.  
  780.                 PROCEDURE TEditText.ImageText(text: Ptr;
  781.                                               length: LONGINT;
  782.                                               box: Rect;
  783.                                               just: INTEGER); OVERRIDE;
  784.                 { Sets up the text to the parameters passed. Text is drawn in a'box' , the text is
  785.                 'length' long. }
  786.  
  787.                 PROCEDURE TEditText.InstallSelection(wasActive, beActive: BOOLEAN); OVERRIDE;
  788.                 { If TEView not NIL then calls TEView.InstallSelection. }
  789.  
  790.                 PROCEDURE TEditText.RestartEdit(restartText: Str255);
  791.                 { This method resets the text of the view, as well as selecting the text. We go to
  792.                 some extra trouble to ensure that this method doesn't do any drawing, defering to
  793.                 window update time. The reasoning is that this method usually gets called right
  794.                 after displaying an alert. The alert may have obscured this view, thus including it
  795.                 in the window's update region. If we drew in this method we would get flashing as
  796.                 this view would get redraw at update time. Unfortunately TextEdit isn't very
  797.                 cooperative so we set the clipping to an empty rect to ensure that TEActivate's
  798.                 drawing isn't seen. }
  799.  
  800.                 PROCEDURE TEditText.ChangeWrap(newAutoWrap, redraw: BOOLEAN); OVERRIDE;
  801.                 { Changes auto-wrapping behavior, redrawing if requested.  Forwards into
  802.                 the floating TE if necessary. }
  803.  
  804.                 PROCEDURE TEditText.SetJustification(theJust: INTEGER;
  805.                                                      redraw: BOOLEAN); OVERRIDE;
  806.                 { Sets the justification of the text to theJust, redrawing is required. }
  807.  
  808.                 PROCEDURE TEditText.SetSelection(selStart, selEnd: INTEGER;
  809.                                                  redraw: BOOLEAN);
  810.                 { Sets the selection in the field starting at selStart and ending at selEnd,
  811.                 redrawing if required. }
  812.  
  813.                 PROCEDURE TEditText.SetText(theText: Str255;
  814.                                             redraw: BOOLEAN); OVERRIDE;
  815.                 { Sets the displayed text to theText, redrawing if required. }
  816.  
  817.                 PROCEDURE TEditText.StartEdit(selectChars: BOOLEAN;
  818.                                               theTEView: TDialogTEView);
  819.                 { Install the selection, revealing the selection if required. }
  820.  
  821.                 PROCEDURE TEditText.StopEdit;
  822.                 { Extracts the string from the TEView, then clears out the TEView before calling
  823.                 SELF.SetText. }
  824.  
  825.                 FUNCTION TEditText.Validate: LONGINT; OVERRIDE;
  826.                 { By default just returns TRUE. }
  827.  
  828.                 PROCEDURE TEditText.Fields(PROCEDURE
  829.                                            DoToField(fieldName: Str255;
  830.                                                      fieldAddr: Ptr;
  831.                                                      fieldType: INTEGER)); OVERRIDE;
  832.                 { Used by the Inspector and the Debugger to display the contents of this class's
  833.                 fields. }
  834.                 END;
  835.  
  836.             NumberTextTemplate    = RECORD
  837.                 value:                LONGINT;
  838.                 minimum:            LONGINT;
  839.                 maximum:            LONGINT;
  840.                 END;
  841.             NumberTextTemplatePtr = ^NumberTextTemplate;
  842.  
  843.             TNumberText         = OBJECT (TEditText)    { This subclass of TEditText that allows the
  844.                                                          handling of integer numbers. Range
  845.                                                          checking will be performed on the numbers
  846.                                                          entered to see if they are in the range
  847.                                                          fMinimum to fMaximum. }
  848.                 fMinimum:            LONGINT;
  849.                 fMaximum:            LONGINT;
  850.  
  851.                 PROCEDURE TNumberText.INumberText(itsSuperView: TView;
  852.                                                   itsLocation, itsSize: VPoint;
  853.                                                   itsValue, itsMinimum, itsMaximum: LONGINT);
  854.                 { Initialize the number text item procedurally. }
  855.  
  856.                 PROCEDURE TNumberText.IRes(itsDocument: TDocument;
  857.                                            itsSuperView: TView;
  858.                                            VAR itsParams: Ptr); OVERRIDE;
  859.                 { Initialize the view template. }
  860.  
  861.                 PROCEDURE TNumberText.WRes(theResource: ViewRsrcHndl;
  862.                                            VAR itsParams: Ptr); OVERRIDE;
  863.                 { Write the object out as a view resource. }
  864.  
  865.                 PROCEDURE TNumberText.WriteRes(theResource: ViewRsrcHndl;
  866.                                                VAR itsParams: Ptr); OVERRIDE;
  867.                 { Set up the type and signature of this object and call WRes. }
  868.  
  869.                 FUNCTION TNumberText.GetValue: LONGINT;
  870.                 { Returns the current value by getting the string and converting it to a number. }
  871.  
  872.                 PROCEDURE TNumberText.SetValue(newValue: LONGINT;
  873.                                                redraw: BOOLEAN);
  874.                 { Sets the current value by converting the number to a string and then calling
  875.                 SetText. }
  876.  
  877.                 FUNCTION TNumberText.Validate: LONGINT; OVERRIDE;
  878.                 { Does a range check on the number and if it is out of range returns the appropriate
  879.                 error code. }
  880.  
  881.                 PROCEDURE TNumberText.Fields(PROCEDURE
  882.                                              DoToField(fieldName: Str255;
  883.                                                        fieldAddr: Ptr;
  884.                                                        fieldType: INTEGER)); OVERRIDE;
  885.                 { Used by the Inspector and the Debugger to display the contents of this class's
  886.                 fields. }
  887.                 END;
  888.  
  889.             TDialogTEView        = OBJECT (TTEView)        { Provides a floating TEView that is placed
  890.                                                          over edit & number text fields when
  891.                                                          entering text. }
  892.                 fEditText:            TEditText;            { The edit text field to which the floating
  893.                                                          TEView is currently tied. }
  894.  
  895.                 fScroller:            TScroller;            { The scroller that I am in for mouseability. }
  896.  
  897.                 PROCEDURE TDialogTEView.IDialogTEView(itsDocument: TDocument; { OK to be NIL, if view will
  898.                                                                    belong to a documentless window
  899.                                                                    }
  900.                                           itsSuperView: TView; { The view in which this view is
  901.                                                                 contained }
  902.                                           itsLocation: VPoint; { Location in its superview }
  903.                                           itsSize: VPoint; { Size of view }
  904.                                           itsHDeterminer: SizeDeterminer; { How to width of the view
  905.                                                                            is to be determined }
  906.                                           itsVDeterminer: SizeDeterminer; { How the height of the
  907.                                                                            view is to be determined
  908.                                                                            }
  909.                                           itsInset: Rect; { Amount to inset text }
  910.                                           itsTextStyle: TextStyle; { Initial text style }
  911.                                           itsJustification: INTEGER; { Its justification }
  912.                                           itsStyleType: BOOLEAN; { Whether or not record is styled }
  913.                                           itsAutoWrap: BOOLEAN { FALSE if newline occurs at CR only
  914.                                                                 }
  915.                                           );
  916.                 { For Initialization of procedurally created TEView. }
  917.  
  918.                 PROCEDURE TDialogTEView.IRes(itsDocument: TDocument;
  919.                                        itsSuperView: TView;
  920.                                        VAR itsParams: Ptr); OVERRIDE;
  921.                 { Initialize a TTEView via a 'view' resource. }
  922.  
  923.                 PROCEDURE TDialogTEView.Free; OVERRIDE;
  924.                 { Free associated components and then free self. }
  925.  
  926.                 PROCEDURE TDialogTEView.InstallEditText(theEditText: TEditText;
  927.                                                         selectChars: BOOLEAN);
  928.                 { Installs the EditText adding SELF as a subview to EditText, then gets the text
  929.                 from the EditText item and installs it in SELF. }
  930.  
  931.                 PROCEDURE TDialogTEView.ComputeSize(VAR newSize: VPoint); OVERRIDE;
  932.                 { accounts for case in which horizontal determiner is sizeVariable should be added
  933.                 to TTEView !!! }
  934.  
  935.                 PROCEDURE TDialogTEView.InstallSelection(wasActive, beActive: BOOLEAN); OVERRIDE;
  936.                 { If deactivating then invalidate rect before calling inherited InstallSelection. }
  937.  
  938.                 PROCEDURE TDialogTEView.Fields(PROCEDURE
  939.                                                DoToField(fieldName: Str255;
  940.                                                          fieldAddr: Ptr;
  941.                                                          fieldType: INTEGER)); OVERRIDE;
  942.                 { Used by the Inspector and the Debugger to display the contents of this class's
  943.                 fields. }
  944.  
  945.                 FUNCTION TDialogTEView.MakeScroller: TScroller;
  946.                 { Creates the floating scroller that goes with the TE. }
  947.  
  948.                 END;
  949.  
  950.         PROCEDURE InitUDialog;
  951.         { This routine must be called if UDialog is used so that all the necessary initialization can
  952.         be performed. Sets the global flag 'gUDialogInitialized' after the initalization is
  953.         performed. }
  954.  
  955.         PROCEDURE GetMenuColors(popupRect: Rect;
  956.                                 menuID, itemNum: INTEGER;
  957.                                 VAR fColor, bColor: RGBColor);
  958.         {$ENDC}
  959.  
  960.         {$IFC NOT UsingIncludes}
  961. END.
  962. {$ENDC}
  963.